<style lang="stylus" type="text/stylus">
@import 'monitorAllChks.styl';
</style>

<template>
  <div id="monitorAllChks">
    <div class="monitorAllChksLeft">
      <div class="monitorAllChksNav">
        <div :class="{'active':!tapChks}" class="navTabLeft" @click="showViewByLink(0)">按环节查看</div>
        <span class="underline1" v-if="!tapChks"></span>
        <div :class="{'active':tapChks}" class="navTabRight" @click="showViewByLink(1)">按负责人查看</div>
        <span class="underline2" v-if="tapChks"></span>
      </div>
      <div class="monitorAllChksContent">
        <VuePerfectScrollbar ref="policyLists" class="contentScroll">
          <!-- 按环节或政策查看 -->
          <ul class="viewByLink" v-if="!tapChks">
            <li :class="{'chooseTargetActive':isChoosed01}" class="contentList01" @click="choosedTarget01">
              <div class="contentList01Top">
                <Icon type="android-calendar"></Icon>&nbsp;&nbsp;
                <span>全部申请</span>
              </div>
              <div class="contentList01Bottom">
                <span class="contentList01Bottom01">{{findExamineListItem.length}}</span>
              </div>
            </li>
            <li :class="{'chooseTargetActive':isChoosed02}" class="contentList01" @click="choosedTarget02">
              <div class="contentList01Top">
                <Icon type="android-clipboard"></Icon>&nbsp;&nbsp;
                <span>未开始</span>
              </div>
              <div class="contentList01Bottom">
                <span class="contentList01Bottom01">{{allNotStartWorkList.totalCount}}</span>
              </div>
            </li>
            <li :class="{'chooseTargetActive':isChoosed03}" class="contentList01" @click="choosedTarget03">
              <div class="contentList01Top">
                <Icon type="android-done-all"></Icon>&nbsp;&nbsp;
                <span>审核完毕</span>
              </div>
              <div class="contentList01Bottom">
                <span class="contentList01Bottom01">{{allDoneWork.totalCount}}</span>
              </div>
            </li>
          </ul>
          <!-- 政策列表 -->
          <ul class="policyList" v-show="!tapChks">
            <li class="contentList02" v-for="(policyList,index) in policyData" :key="index"
                @click="chooseTargetPolicy(policyList.id)" :class='{"checkedActive":classId==policyList.id}'>
              <div class="contentList02Top">
                <span class="contentList02Top02">政策{{index + 1}}：{{policyList.shortTitle}}</span>
              </div>
              <div class="contentList02Bottom">
                <span v-show="policyList.id == policyId.id" v-for="policyId in policiesStatisticList"
                      :key="policyId.id">{{policyId.count}}</span>
                <span>0</span>
              </div>
            </li>
          </ul>
          <!-- 按负责人查看 -->
          <ul class="checkPersonCharge" v-show="tapChks">
            <li :class="{'chooseTargetActive':isChoosed01}" class="contentList03" @click="choosedTarget01">
              <div class="contentList03Top">
                <Icon type="android-calendar"></Icon>&nbsp;&nbsp;
                <span>全部申请</span>
              </div>
              <div class="contentList03Bottom">
                <span></span>
                <span>{{findExamineListItem.length}}</span>
              </div>
            </li>
            <li :class="{'chooseTargetActive':isChoosed02}" class="contentList03" @click="choosedTarget04">
              <div class="contentList03Top">
                <Icon type="android-people"></Icon>&nbsp;&nbsp;
                <span>管理员</span>
              </div>
              <div class="contentList03Bottom">
                <span class="contentList004Top01">尚未处理的</span>
                <span class="contentList004Bottom01">{{wardenList.totalCount}}</span>
              </div>
            </li>
          </ul>
          <!-- 管理机构列表 -->
          <ul class="organizationList" v-show="tapChks">
            <li class="contentList04" v-for="(item,index) in organizationList" :key="index">
              <div class="contentListTitle">{{item.name}}</div>
              <ul class="contentList04Top">
                <li class="contentList04Info"
                    v-for="items in organizationList[index].children ? organizationList[index].children : organizationList[index].users"
                    :key="items.id" @click="chooseTargetOrg(items.id)" :class='{"checkedActive":classId==items.id}'>
                  <div class="contentList004Top">
                    <span>{{items.name}}</span>
                  </div>
                  <div class="contentList004Bottom">
                    <span class="contentList004Top01">尚未处理的</span>
                    <div class="contentList004Bottom01">
                      <span v-show="items.id == orgListId.id" v-for="orgListId in organizationsStatisticList"
                            :key="orgListId.id">{{orgListId.count}}</span>
                      <span>0</span>
                    </div>
                  </div>
                </li>
              </ul>
            </li>
          </ul>
        </VuePerfectScrollbar>
      </div>
    </div>
    <!-- 申请卡片展示 -->
    <div class="monitorAllChksRight">
      <VuePerfectScrollbar ref="policyLists" class="monitorAllChksRightContent">
        <ul class="chksContentList">
          <li v-show="isShowAllList" @click="targetCheckInfo(item.id)" v-for="item in findExamineListItem"
              :key="item.id">
            <div class="chksContentInfo">
              <div class="chksContentTop">
                <!-- 企业名 -->
                <span class="chksContentTopTitle">{{item.companyName}}</span>
              </div>
              <div class="chksContentCenter">
                <div class="chksContentCenterTop">
                  <!-- 审核状态 -->
                  <div v-show="item.applyStatus==30 || item.applyStatus==31" class="auditStatus">
                    <span class="auditStatusTitle">审核状态</span>
                    <div v-if="item.processInstance.activities.length==2" class="auditStatusContent">
                      <ul>
                        <!-- <li v-for="items in item.processInstance.activities[1].children" :key="items.id">
                          {{items.name}}
                          <span v-show="items.ended == true" class="status01">完成</span>
                          <span v-show="items.ended == false" class="status02">进行中</span>
                        </li> -->
                        <li v-for="items in item.processInstance.activities[1].children" :key="items.id">
                            {{items.name}}
                            <span v-show="items.ended == true" class="status01">完成</span>
                            <span v-show="items.ended == false && items.replyStatus==''" class="status02">进行中</span>
                            <span v-show="items.ended == false && items.replyStatus=='1'" class="status02">待补充材料</span>
                            <span v-show="items.ended == false && items.replyStatus=='2'" class="status02">补充材料已提交</span>
                          </li>
                      </ul>
                    </div>
                    <div v-show="item.processInstance.activities.length==1">
                      <span>未开始，待管理员开始</span>
                    </div>
                    <div v-show="item.processInstance.activities.length==3">
                      <span>审核完毕，待管理员结案</span>
                    </div>
                  </div>
                  <div v-show="item.applyStatus!=30 && item.applyStatus!=31" class="auditStatus">
                    <span class="auditStatusTitle">审核已完结</span>
                    <p v-show="item.applyStatus == 38" class="auditStatusTitleInfoOk">已批准拨款</p>
                    <p v-show="item.applyStatus == 39" class="auditStatusTitleInfoNo">已拒绝拨款</p>
                    <p v-show="item.applyStatus == 49 || item.applyStatus == 42" class="auditStatusTitleInfoInterrupt">
                      已强制中断</p>
                  </div>
                  <!-- 申请概况 -->
                  <div class="applicationProfile">
                    <span class="applicationProfileTitle">申请概况</span>
                    <span class="textBlod">政策{{item.policyId}}：{{item.policyShortTitle}}</span>
                    <ul>
                      <li v-for="items in item.applyPrizes" :key="items.prizeId">{{items.prizeTitle}}（<span>{{items.amount}}万</span>）
                      </li>
                    </ul>
                    <div class="applyAmount">申请总额：<span>{{item.applyAmount}}万</span></div>
                  </div>
                </div>
              </div>
              <div class="chksContentBottom">
                <div class="chksContentBottomTitle">时间统计</div>
                <div class="timeStatisticsInfo">
                  <ul class="infoLeft">
                    <li>线上申请提交：<span>{{item.applyAt | formatDate}}</span>（{{Math.ceil((nowTime - item.applyAt) /
                      (24*60*60*1000))-1}}天前）
                    </li>
                    <li>线下办理：<span>{{item.lastUpdateAt | formatDate}}</span>（{{Math.ceil((nowTime - item.lastUpdateAt) /
                      (24*60*60*1000))-1}}天前）
                    </li>
                    <li>进入线下审核：<span>{{item.processInstance.activities[0].startAt | formatDate}}</span>（{{Math.ceil((nowTime
                      - item.processInstance.activities[0].startAt) / (24*60*60*1000))-1}}天前）
                    </li>
                    <li v-show="item.processInstance.endAt != null">线下审核总耗时：已完结 （{{Math.ceil((item.processInstance.endAt
                      - item.processInstance.startAt) / (24*60*60*1000))-1}}天）
                    </li>
                    <li v-show="item.processInstance.endAt == null">线下审核总耗时： 进行中 （{{Math.ceil((nowTime -
                      item.processInstance.startAt) / (24*60*60*1000))-1}}天）
                    </li>
                  </ul>
                </div>
              </div>
            </div>
          </li>
          <li v-show="isShowNotStartList" @click="targetCheckInfo(item.id)" v-for="item in allNotStartWorkList01"
              :key="item.id">
            <div class="chksContentInfo">
              <div class="chksContentTop">
                <!-- 企业名 -->
                <span class="chksContentTopTitle">{{item.companyName}}</span>
              </div>
              <div class="chksContentCenter">
                <div class="chksContentCenterTop">
                  <!-- 审核状态 -->
                  <!-- 审核状态 -->
                  <div v-show="item.applyStatus==30 || item.applyStatus==31" class="auditStatus">
                    <span class="auditStatusTitle">审核状态</span>
                    <div v-if="item.processInstance.activities.length==2" class="auditStatusContent">
                      <ul>
                        <!-- <li v-for="items in item.processInstance.activities[1].children" :key="items.id">
                          {{items.name}}
                          <span v-show="items.ended == true" class="status01">完成</span>
                          <span v-show="items.ended == false" class="status02">进行中</span>
                        </li> -->
                        <li v-for="items in item.processInstance.activities[1].children" :key="items.id">
                            {{items.name}}
                            <span v-show="items.ended == true" class="status01">完成</span>
                            <span v-show="items.ended == false && items.replyStatus==''" class="status02">进行中</span>
                            <span v-show="items.ended == false && items.replyStatus=='1'" class="status02">待补充材料</span>
                            <span v-show="items.ended == false && items.replyStatus=='2'" class="status02">补充材料已提交</span>
                        </li>
                      </ul>
                    </div>
                    <div v-show="item.processInstance.activities.length==1">
                      <span>未开始，待管理员开始</span>
                    </div>
                    <div v-show="item.processInstance.activities.length==3">
                      <span>审核完毕，待管理员结案</span>
                    </div>
                  </div>
                  <div v-show="item.applyStatus!=30 && item.applyStatus!=31" class="auditStatus">
                    <span class="auditStatusTitle">审核已完结</span>
                    <p v-show="item.applyStatus == 38" class="auditStatusTitleInfoOk">已批准拨款</p>
                    <p v-show="item.applyStatus == 39" class="auditStatusTitleInfoNo">已拒绝拨款</p>
                    <p v-show="item.applyStatus == 49 || item.applyStatus == 42" class="auditStatusTitleInfoInterrupt">
                      已强制中断</p>
                  </div>
                  <!-- 申请概况 -->
                  <div class="applicationProfile">
                    <span class="applicationProfileTitle">申请概况</span>
                    <span class="textBlod">政策{{item.policyId}}：{{item.policyShortTitle}}</span>
                    <ul>
                      <li v-for="items in item.applyPrizes" :key="items.prizeId">{{items.prizeTitle}}（<span>{{items.amount}}万</span>）
                      </li>
                    </ul>
                    <div class="applyAmount">申请总额：<span>{{item.applyAmount}}万</span></div>
                  </div>
                </div>
              </div>
              <div class="chksContentBottom">
                <div class="chksContentBottomTitle">时间统计</div>
                <div class="timeStatisticsInfo">
                  <ul class="infoLeft">
                    <li>线上申请提交：<span>{{item.applyAt | formatDate}}</span>（{{Math.ceil((nowTime - item.applyAt) /
                      (24*60*60*1000))}}天前）
                    </li>
                    <li>线下办理：<span>{{item.lastUpdateAt | formatDate}}</span>（{{Math.ceil((nowTime - item.lastUpdateAt) /
                      (24*60*60*1000))}}天前）
                    </li>
                    <li>进入线下审核：<span>{{item.processInstance.activities[0].startAt | formatDate}}</span>（{{Math.ceil((nowTime
                      - item.processInstance.activities[0].startAt) / (24*60*60*1000))}}天前）
                    </li>
                    <li v-show="item.processInstance.endAt != null">线下审核总耗时：已完结 （{{Math.ceil((item.processInstance.endAt
                      - item.processInstance.startAt) / (24*60*60*1000))}}天）
                    </li>
                    <li v-show="item.processInstance.endAt == null">线下审核总耗时： 进行中 （{{Math.ceil((nowTime -
                      item.processInstance.startAt) / (24*60*60*1000))}}天）
                    </li>
                  </ul>
                </div>
              </div>
            </div>
          </li>
          <li v-show="isShowDoneList" @click="targetCheckInfo(item.id)" v-for="item in allDoneWork01" :key="item.id">
            <div class="chksContentInfo">
              <div class="chksContentTop">
                <!-- 企业名 -->
                <span class="chksContentTopTitle">{{item.companyName}}</span>
              </div>
              <div class="chksContentCenter">
                <div class="chksContentCenterTop">
                  <!-- 审核状态 -->
                  <!-- 审核状态 -->
                  <div v-show="item.applyStatus==30 || item.applyStatus==31" class="auditStatus">
                    <span class="auditStatusTitle">审核状态</span>
                    <div v-if="item.processInstance.activities.length==2" class="auditStatusContent">
                      <ul>
                        <!-- <li v-for="items in item.processInstance.activities[1].children" :key="items.id">
                          {{items.name}}<span v-show="items.ended == true" class="status01">完成</span><span
                          v-show="items.ended == false" class="status02">进行中</span></li> -->
                          <li v-for="items in item.processInstance.activities[1].children" :key="items.id">
                            {{items.name}}
                            <span v-show="items.ended == true" class="status01">完成</span>
                            <span v-show="items.ended == false && items.replyStatus==''" class="status02">进行中</span>
                            <span v-show="items.ended == false && items.replyStatus=='1'" class="status02">待补充材料</span>
                            <span v-show="items.ended == false && items.replyStatus=='2'" class="status02">补充材料已提交</span>
                        </li>
                      </ul>
                    </div>
                    <div v-show="item.processInstance.activities.length==1">
                      <span>未开始，待管理员开始</span>
                    </div>
                    <div v-show="item.processInstance.activities.length==3">
                      <span>审核完毕，待管理员结案</span>
                    </div>
                  </div>
                  <div v-show="item.applyStatus!=30 && item.applyStatus!=31" class="auditStatus">
                    <span class="auditStatusTitle">审核已完结</span>
                    <p v-show="item.applyStatus == 38" class="auditStatusTitleInfoOk">已批准拨款</p>
                    <p v-show="item.applyStatus == 39" class="auditStatusTitleInfoNo">已拒绝拨款</p>
                    <p v-show="item.applyStatus == 49 || item.applyStatus == 42" class="auditStatusTitleInfoInterrupt">
                      已强制中断</p>
                  </div>
                  <!-- 申请概况 -->
                  <div class="applicationProfile">
                    <span class="applicationProfileTitle">申请概况</span>
                    <span class="textBlod">政策{{item.policyId}}：{{item.policyShortTitle}}</span>
                    <ul>
                      <li v-for="items in item.applyPrizes" :key="items.prizeId">{{items.prizeTitle}}（<span>{{items.amount}}万</span>）
                      </li>
                    </ul>
                    <div class="applyAmount">申请总额：<span>{{item.applyAmount}}万</span></div>
                  </div>
                </div>
              </div>
              <div class="chksContentBottom">
                <div class="chksContentBottomTitle">时间统计</div>
                <div class="timeStatisticsInfo">
                  <ul class="infoLeft">
                    <li>线上申请提交：<span>{{item.applyAt | formatDate}}</span>（{{Math.ceil((nowTime - item.applyAt) /
                      (24*60*60*1000))}}天前）
                    </li>
                    <li>线下办理：<span>{{item.lastUpdateAt | formatDate}}</span>（{{Math.ceil((nowTime - item.lastUpdateAt) /
                      (24*60*60*1000))}}天前）
                    </li>
                    <li>进入线下审核：<span>{{item.processInstance.activities[0].startAt | formatDate}}</span>（{{Math.ceil((nowTime
                      - item.processInstance.activities[0].startAt) / (24*60*60*1000))}}天前）
                    </li>
                    <li v-show="item.processInstance.endAt != null">线下审核总耗时：已完结 （{{Math.ceil((item.processInstance.endAt
                      - item.processInstance.startAt) / (24*60*60*1000))}}天）
                    </li>
                    <li v-show="item.processInstance.endAt == null">线下审核总耗时： 进行中 （{{Math.ceil((nowTime -
                      item.processInstance.startAt) / (24*60*60*1000))}}天）
                    </li>
                  </ul>
                </div>
              </div>
            </div>
          </li>
          <li v-show="isShowWardenList" @click="targetCheckInfo(item.id)" v-for="item in wardenList01" :key="item.id">
            <div class="chksContentInfo">
              <div class="chksContentTop">
                <!-- 企业名 -->
                <span class="chksContentTopTitle">{{item.companyName}}</span>
              </div>
              <div class="chksContentCenter">
                <div class="chksContentCenterTop">
                  <!-- 审核状态 -->
                  <!-- 审核状态 -->
                  <div v-show="item.applyStatus==30 || item.applyStatus==31" class="auditStatus">
                    <span class="auditStatusTitle">审核状态</span>
                    <div v-if="item.processInstance.activities.length==2" class="auditStatusContent">
                      <ul>
                        <!-- <li v-for="items in item.processInstance.activities[1].children" :key="items.id">
                          {{items.name}}<span v-show="items.ended == true" class="status01">完成</span><span
                          v-show="items.ended == false" class="status02">进行中</span></li> -->
                          <li v-for="items in item.processInstance.activities[1].children" :key="items.id">
                            {{items.name}}
                            <span v-show="items.ended == true" class="status01">完成</span>
                            <span v-show="items.ended == false && items.replyStatus==''" class="status02">进行中</span>
                            <span v-show="items.ended == false && items.replyStatus=='1'" class="status02">待补充材料</span>
                            <span v-show="items.ended == false && items.replyStatus=='2'" class="status02">补充材料已提交</span>
                        </li>
                      </ul>
                    </div>
                    <div v-show="item.processInstance.activities.length==1">
                      <span>未开始，待管理员开始</span>
                    </div>
                    <div v-show="item.processInstance.activities.length==3">
                      <span>审核完毕，待管理员结案</span>
                    </div>
                  </div>
                  <div v-show="item.applyStatus!=30 && item.applyStatus!=31" class="auditStatus">
                    <span class="auditStatusTitle">审核已完结</span>
                    <p v-show="item.applyStatus == 38" class="auditStatusTitleInfoOk">已批准拨款</p>
                    <p v-show="item.applyStatus == 39" class="auditStatusTitleInfoNo">已拒绝拨款</p>
                    <p v-show="item.applyStatus == 49 || item.applyStatus == 42" class="auditStatusTitleInfoInterrupt">
                      已强制中断</p>
                  </div>
                  <!-- 申请概况 -->
                  <div class="applicationProfile">
                    <span class="applicationProfileTitle">申请概况</span>
                    <span class="textBlod">政策{{item.policyId}}：{{item.policyShortTitle}}</span>
                    <ul>
                      <li v-for="items in item.applyPrizes" :key="items.prizeId">{{items.prizeTitle}}（<span>{{items.amount}}万</span>）
                      </li>
                    </ul>
                    <div class="applyAmount">申请总额：<span>{{item.applyAmount}}万</span></div>
                  </div>
                </div>
              </div>
              <div class="chksContentBottom">
                <div class="chksContentBottomTitle">时间统计</div>
                <div class="timeStatisticsInfo">
                  <ul class="infoLeft">
                    <li>线上申请提交：<span>{{item.applyAt | formatDate}}</span>（{{Math.ceil((nowTime - item.applyAt) /
                      (24*60*60*1000))}}天前）
                    </li>
                    <li>线下办理：<span>{{item.lastUpdateAt | formatDate}}</span>（{{Math.ceil((nowTime - item.lastUpdateAt) /
                      (24*60*60*1000))}}天前）
                    </li>
                    <li>进入线下审核：<span>{{item.processInstance.activities[0].startAt | formatDate}}</span>（{{Math.ceil((nowTime
                      - item.processInstance.activities[0].startAt) / (24*60*60*1000))}}天前）
                    </li>
                    <li v-show="item.processInstance.endAt != null">线下审核总耗时：已完结 （{{Math.ceil((item.processInstance.endAt
                      - item.processInstance.startAt) / (24*60*60*1000))}}天）
                    </li>
                    <li v-show="item.processInstance.endAt == null">线下审核总耗时： 进行中 （{{Math.ceil((nowTime -
                      item.processInstance.startAt) / (24*60*60*1000))}}天）
                    </li>
                  </ul>
                </div>
              </div>
            </div>
          </li>
          <li v-show="isShowtargetPolicyList" @click="targetCheckInfo(item.id)" v-for="item in targetPolicyList01"
              :key="item.id">
            <div class="chksContentInfo">
              <div class="chksContentTop">
                <!-- 企业名 -->
                <span class="chksContentTopTitle">{{item.companyName}}</span>
              </div>
              <div class="chksContentCenter">
                <div class="chksContentCenterTop">
                  <!-- 审核状态 -->
                  <!-- 审核状态 -->
                  <div v-show="item.applyStatus==30 || item.applyStatus==31" class="auditStatus">
                    <span class="auditStatusTitle">审核状态</span>
                    <div v-if="item.processInstance.activities.length==2" class="auditStatusContent">
                      <ul>
                        <!-- <li v-for="items in item.processInstance.activities[1].children" :key="items.id">
                          {{items.name}}<span v-show="items.ended == true" class="status01">完成</span><span
                          v-show="items.ended == false" class="status02">进行中</span></li> -->
                          <li v-for="items in item.processInstance.activities[1].children" :key="items.id">
                            {{items.name}}
                            <span v-show="items.ended == true" class="status01">完成</span>
                            <span v-show="items.ended == false && items.replyStatus==''" class="status02">进行中</span>
                            <span v-show="items.ended == false && items.replyStatus=='1'" class="status02">待补充材料</span>
                            <span v-show="items.ended == false && items.replyStatus=='2'" class="status02">补充材料已提交</span>
                          </li>
                      </ul>
                    </div>
                    <div v-show="item.processInstance.activities.length==1">
                      <span>未开始，待管理员开始</span>
                    </div>
                    <div v-show="item.processInstance.activities.length==3">
                      <span>审核完毕，待管理员结案</span>
                    </div>
                  </div>
                  <div v-show="item.applyStatus!=30 && item.applyStatus!=31" class="auditStatus">
                    <span class="auditStatusTitle">审核已完结</span>
                    <p v-show="item.applyStatus == 38" class="auditStatusTitleInfoOk">已批准拨款</p>
                    <p v-show="item.applyStatus == 39" class="auditStatusTitleInfoNo">已拒绝拨款</p>
                    <p v-show="item.applyStatus == 49 || item.applyStatus == 42" class="auditStatusTitleInfoInterrupt">
                      已强制中断</p>
                  </div>
                  <!-- 申请概况 -->
                  <div class="applicationProfile">
                    <span class="applicationProfileTitle">申请概况</span>
                    <span class="textBlod">政策{{item.policyId}}：{{item.policyShortTitle}}</span>
                    <ul>
                      <li v-for="items in item.applyPrizes" :key="items.prizeId">{{items.prizeTitle}}（<span>{{items.amount}}万</span>）
                      </li>
                    </ul>
                    <div class="applyAmount">申请总额：<span>{{item.applyAmount}}万</span></div>
                  </div>
                </div>
              </div>
              <div class="chksContentBottom">
                <div class="chksContentBottomTitle">时间统计</div>
                <div class="timeStatisticsInfo">
                  <ul class="infoLeft">
                    <li>线上申请提交：<span>{{item.applyAt | formatDate}}</span>（{{Math.ceil((nowTime - item.applyAt) /
                      (24*60*60*1000))}}天前）
                    </li>
                    <li>线下办理：<span>{{item.lastUpdateAt | formatDate}}</span>（{{Math.ceil((nowTime - item.lastUpdateAt) /
                      (24*60*60*1000))}}天前）
                    </li>
                    <li>进入线下审核：<span>{{item.processInstance.activities[0].startAt | formatDate}}</span>（{{Math.ceil((nowTime
                      - item.processInstance.activities[0].startAt) / (24*60*60*1000))}}天前）
                    </li>
                    <li v-show="item.processInstance.endAt != null">线下审核总耗时：已完结 （{{Math.ceil((item.processInstance.endAt
                      - item.processInstance.startAt) / (24*60*60*1000))}}天）
                    </li>
                    <li v-show="item.processInstance.endAt == null">线下审核总耗时： 进行中 （{{Math.ceil((nowTime -
                      item.processInstance.startAt) / (24*60*60*1000))}}天）
                    </li>
                  </ul>
                </div>
              </div>
            </div>
          </li>
          <li v-show="isShowtargetOrgList" @click="targetCheckInfo(item.id)" v-for="item in targetOrgList01"
              :key="item.id">
            <div class="chksContentInfo">
              <div class="chksContentTop">
                <!-- 企业名 -->
                <span class="chksContentTopTitle">{{item.companyName}}</span>
              </div>
              <div class="chksContentCenter">
                <div class="chksContentCenterTop">
                  <!-- 审核状态 -->
                  <!-- 审核状态 -->
                  <div v-show="item.applyStatus==30 || item.applyStatus==31" class="auditStatus">
                    <span class="auditStatusTitle">审核状态</span>
                    <div v-if="item.processInstance.activities.length==2" class="auditStatusContent">
                      <ul>
                        <!-- <li v-for="items in item.processInstance.activities[1].children" :key="items.id">
                          {{items.name}}<span v-show="items.ended == true" class="status01">完成</span><span
                          v-show="items.ended == false" class="status02">进行中</span></li> -->
                          <li v-for="items in item.processInstance.activities[1].children" :key="items.id">
                            {{items.name}}
                            <span v-show="items.ended == true" class="status01">完成</span>
                            <span v-show="items.ended == false && items.replyStatus==''" class="status02">进行中</span>
                            <span v-show="items.ended == false && items.replyStatus=='1'" class="status02">待补充材料</span>
                            <span v-show="items.ended == false && items.replyStatus=='2'" class="status02">补充材料已提交</span>
                        </li>
                      </ul>
                    </div>
                    <div v-show="item.processInstance.activities.length==1">
                      <span>未开始，待管理员开始</span>
                    </div>
                    <div v-show="item.processInstance.activities.length==3">
                      <span>审核完毕，待管理员结案</span>
                    </div>
                  </div>
                  <div v-show="item.applyStatus!=30 && item.applyStatus!=31" class="auditStatus">
                    <span class="auditStatusTitle">审核已完结</span>
                    <p v-show="item.applyStatus == 38" class="auditStatusTitleInfoOk">已批准拨款</p>
                    <p v-show="item.applyStatus == 39" class="auditStatusTitleInfoNo">已拒绝拨款</p>
                    <p v-show="item.applyStatus == 49 || item.applyStatus == 42" class="auditStatusTitleInfoInterrupt">
                      已强制中断</p>
                  </div>
                  <!-- 申请概况 -->
                  <div class="applicationProfile">
                    <span class="applicationProfileTitle">申请概况</span>
                    <span class="textBlod">政策{{item.policyId}}：{{item.policyShortTitle}}</span>
                    <ul>
                      <li v-for="items in item.applyPrizes" :key="items.prizeId">{{items.prizeTitle}}（<span>{{items.amount}}万</span>）
                      </li>
                    </ul>
                    <div class="applyAmount">申请总额：<span>{{item.applyAmount}}万</span></div>
                  </div>
                </div>
              </div>
              <div class="chksContentBottom">
                <div class="chksContentBottomTitle">时间统计</div>
                <div class="timeStatisticsInfo">
                  <ul class="infoLeft">
                    <li>线上申请提交：<span>{{item.applyAt | formatDate}}</span>（{{Math.ceil((nowTime - item.applyAt) /
                      (24*60*60*1000))}}天前）
                    </li>
                    <li>线下办理：<span>{{item.lastUpdateAt | formatDate}}</span>（{{Math.ceil((nowTime - item.lastUpdateAt) /
                      (24*60*60*1000))}}天前）
                    </li>
                    <li>进入线下审核：<span>{{item.processInstance.activities[0].startAt | formatDate}}</span>（{{Math.ceil((nowTime
                      - item.processInstance.activities[0].startAt) / (24*60*60*1000))}}天前）
                    </li>
                    <li v-show="item.processInstance.endAt != null">线下审核总耗时：已完结 （{{Math.ceil((item.processInstance.endAt
                      - item.processInstance.startAt) / (24*60*60*1000))}}天）
                    </li>
                    <li v-show="item.processInstance.endAt == null">线下审核总耗时： 进行中 （{{Math.ceil((nowTime -
                      item.processInstance.startAt) / (24*60*60*1000))}}天）
                    </li>
                  </ul>
                </div>
              </div>
            </div>
          </li>
          <div class="notContent" v-show="findExamineListItem.length == 0 && isShowNotContent01">
            <i class="icon iconfont icon-zanwuneirong"></i>
            <div class="name">暂无内容</div>
          </div>
          <div class="notContent" v-show="allNotStartWorkList01.length == 0 && isShowNotContent02">
            <i class="icon iconfont icon-zanwuneirong"></i>
            <div class="name">暂无内容</div>
          </div>
          <div class="notContent" v-show="allDoneWork01.length == 0 && isShowNotContent03">
            <i class="icon iconfont icon-zanwuneirong"></i>
            <div class="name">暂无内容</div>
          </div>
          <div class="notContent" v-show="wardenList01.length == 0 && isShowNotContent04">
            <i class="icon iconfont icon-zanwuneirong"></i>
            <div class="name">暂无内容</div>
          </div>
          <div class="notContent" v-show="targetPolicyList01.length == 0 && isShowNotContent05">
            <i class="icon iconfont icon-zanwuneirong"></i>
            <div class="name">暂无内容</div>
          </div>
          <div class="notContent" v-show="targetOrgList01.length == 0 && isShowNotContent06">
            <i class="icon iconfont icon-zanwuneirong"></i>
            <div class="name">暂无内容</div>
          </div>
        </ul>
      </VuePerfectScrollbar>
    </div>
  </div>
</template>

<script type="text/ecmascript-6">
import { formatDate } from "../../../common/date.js";

export default {
  name: "monitorAllChk",
  data() {
    return {
      policiesStatisticList: [], // 政策申请数统计
      organizationsStatisticList: [], // 组织申请数统计
      findExamineListItem: [], // 申请实例列表
      id: "", // 当前实例id
      policyData: [], // 政策列表
      policyId: "", // 政策id
      allNotStartWorkList: {}, // 未开始列表
      allNotStartWorkList01: [],
      allDoneWork: {}, // 审核完毕列表
      allDoneWork01: [],
      organizationList: [], // 组织列表
      orgIdListInfo: [],
      wardenList: {}, // 管理员申请列表
      // organizationList02:[],
      wardenList01: [],
      targetPolicyList: {}, // 通过政策获取列表
      targetPolicyList01: [],
      targetPolicyList02: [],
      targetOrgList: {}, // 通过机构获取列表
      targetOrgList01: [],
      nowTime: "", // 当前时间
      tapChks: 0, // 状态判断（判断查看主体）

      isShowAllList: true, // 全部申请
      isShowNotStartList: false, // 未开始
      isShowDoneList: false, // 审核完毕
      isShowWardenList: false, // 管理员
      isShowtargetPolicyList: false, // 当前政策下的申请列表

      // 判断“暂无内容”是否出现的条件
      isShowNotContent01: false,
      isShowNotContent02: false,
      isShowNotContent03: false,
      isShowNotContent04: false,
      isShowNotContent05: false,
      isShowNotContent06: false,

      // 临时状态，待有数据后根据数据判断
      isChoosed01: true,
      isChoosed02: false,
      isChoosed03: false,

      classId: null
    };
  },
  filters: {
    formatDate(time) {
      let date = new Date(time);
      return formatDate(date, "yyyy年MM月dd日");
    }
  },
  beforeMount() {
    //  获取政策列表
    this.getAllPolicyList();
  },
  mounted() {
    //  获取政策列表
    this.showViewByLink(this.getRouteQuery.tapChks);
    this.getAllNotStartWork();
    this.getAllDoneWork();
    this.getAllOrganization();
    this.getWardenList();
    this.getNowTime();
    this.getStatisticList();
  },
  computed: {
    getRouteQuery() {
      return this.$route.query;
    }
  },
  methods: {
    //  获取当前时间
    getNowTime() {
      this.nowTime = Date.parse(new Date());
    },
    //  获取未完结申请统计
    getStatisticList() {
      this.ajaxData(
        {
          type: "get",
          url: "/workflow/allwork/statistic"
        },
        (res, all) => {
          this.organizationsStatisticList = res.organizations;
          this.policiesStatisticList = res.policies;
        }
      );
    },
    //  获取政策列表
    getAllPolicyList() {
      this.ajaxData(
        {
          type: "get",
          url: "/workflow/process/page",
          data: {
            page: 1,
            pageSize: 100
          }
        },
        (res, all) => {
          this.policyData = res.results;
        }
      );
    },
    getPolicyData() {
      this.getAllPolicyList = setTimeout(() => {
        for (var i = 1; i <= this.policyData.length; i++) {
          let policyId = i;
          this.ajaxData(
            {
              urlv2: "1",
              type: "get",
              url: "/workflow/allwork",
              async: false,
              cache: true,
              data: {
                policyId: policyId,
                page: 1,
                pageSize: 100
              }
            },
            (res, all) => {
              this.targetPolicyList002 = res.totalCount;
            }
          );
          this.targetPolicyList02.push(this.targetPolicyList002);
        }
      }, 1000);
    },
    //    获取未开始列表
    getAllNotStartWork() {
      (this.isShowNotContent01 = false),
        (this.isShowNotContent02 = true),
        (this.isShowNotContent03 = false),
        (this.isShowNotContent04 = false),
        (this.isShowNotContent05 = false),
        (this.isShowNotContent06 = false),
        this.ajaxData(
          {
            urlv2: "1",
            type: "get",
            url: "/workflow/allwork",
            data: {
              activityType: 0,
              page: 1,
              pageSize: 100
            }
          },
          (res, all) => {
            if (all.code == 0) {
              this.allNotStartWorkList = res;
              this.allNotStartWorkList01 = res.results;
            }
          }
        );
    },
    //    获取审核完毕列表
    getAllDoneWork() {
      (this.isShowNotContent01 = false),
        (this.isShowNotContent02 = false),
        (this.isShowNotContent03 = true),
        (this.isShowNotContent04 = false),
        (this.isShowNotContent05 = false),
        (this.isShowNotContent06 = false),
        this.ajaxData(
          {
            urlv2: "1",
            type: "get",
            url: "/workflow/allwork",
            data: {
              activityType: 2,
              page: 1,
              pageSize: 100
            }
          },
          (res, all) => {
            if (all.code == 0) {
              this.allDoneWork = res;
              this.allDoneWork01 = res.results;
            }
          }
        );
    },
    //    获取管理员申请列表
    getWardenList() {
      (this.isShowNotContent01 = false),
        (this.isShowNotContent02 = false),
        (this.isShowNotContent03 = false),
        (this.isShowNotContent04 = false),
        (this.isShowNotContent05 = false),
        (this.isShowNotContent06 = false),
        this.ajaxData(
          {
            type: "get",
            url: "/workflow/allwork",
            data: {
              userId: this.$store.state.userMsg.loginName,
              page: 1,
              pageSize: 100
            }
          },
          (res, all) => {
            if (all.code == 0) {
              this.wardenList = res;
              this.wardenList01 = res.results;
            }
          }
        );
    },
    //    通过政策获取申请列表
    chooseTargetPolicy(id) {
      (this.isShowNotContent01 = false),
        (this.isShowNotContent02 = false),
        (this.isShowNotContent03 = false),
        (this.isShowNotContent04 = false),
        (this.isShowNotContent05 = true),
        (this.isShowNotContent06 = false),
        (this.isShowAllList = false);
      this.isShowNotStartList = false;
      this.isShowDoneList = false;
      this.isShowWardenList = false;
      this.isShowtargetOrgList = false;
      this.isShowtargetPolicyList = true;

      this.isChoosed01 = false;
      this.isChoosed02 = false;
      this.isChoosed03 = false;

      this.policyId = id;
      this.classId = this.policyId;
      this.ajaxData(
        {
          urlv2: "1",
          type: "get",
          url: "/workflow/allwork",
          data: {
            policyId: this.policyId,
            page: 1,
            pageSize: 100
          }
        },
        (res, all) => {
          if (all.code == 0) {
            this.targetPolicyList = res;
            this.targetPolicyList01 = res.results;
          }
        }
      );
    },
    //    通过机构获取申请列表
    chooseTargetOrg(id) {
      (this.isShowNotContent01 = false),
        (this.isShowNotContent02 = false),
        (this.isShowNotContent03 = false),
        (this.isShowNotContent04 = false),
        (this.isShowNotContent05 = false),
        (this.isShowNotContent06 = true),
        (this.isShowAllList = false);
      this.isShowNotStartList = false;
      this.isShowDoneList = false;
      this.isShowWardenList = false;
      this.isShowtargetOrgList = true;
      this.isShowtargetPolicyList = false;

      this.isChoosed01 = false;
      this.isChoosed02 = false;
      this.isChoosed03 = false;

      this.orgId = id;
      this.classId = this.orgId;
      this.ajaxData(
        {
          type: "get",
          url: "/workflow/allwork",
          data: {
            orgId: this.orgId,
            page: 1,
            pageSize: 100
          }
        },
        (res, all) => {
          if (all.code == 0) {
            this.targetOrgList = res;
            this.targetOrgList01 = res.results;
          }
        }
      );
    },
    //    按环节查看
    showViewByLink(n) {
      this.tapChks = n;
      this.ajaxData(
        {
          type: "get",
          url: "/workflow/allwork",
          data: {
            page: 1,
            pageSize: 100
          }
        },
        (res, all) => {
          if (all.code == 0) {
            this.findExamineListItem = res.results;
            setTimeout(() => {
              document.querySelector(".monitorAllChksRightContent").scrollTop =
                this.getRouteQuery.scrolltop || 0;
              this.$refs.policyLists.update();
            }, 10);
          }
        }
      );
      this.choosedTarget01();
    },
    getAllOrganization() {
      this.ajaxData(
        {
          urlv2: "1",
          type: "get",
          url: "/workflow/organization",
          async: false,
          cache: true,
          data: {
            page: 1,
            pageSize: 100
          }
        },
        (res, all) => {
          if (all.code == 0) {
            this.organizationList = res;
          }
        }
      );
    },
    targetCheckInfo(id) {
      this.$router.push({
        path: "/component",
        name: "Component",
        query: {
          policyId: this.policyId,
          tapChks: this.tapChks,
          id: id,
          name: "monitorAllChks",
          pageName: "监控所有审核",
          scrolltop: document.querySelector(".monitorAllChksRightContent")
            .scrollTop
        }
      });
    },
    //    全部申请
    choosedTarget01() {
      this.classId = null;

      this.isChoosed01 = true;
      this.isChoosed02 = false;
      this.isChoosed03 = false;

      (this.isShowNotContent01 = true),
        (this.isShowNotContent02 = false),
        (this.isShowNotContent03 = false),
        (this.isShowNotContent04 = false),
        (this.isShowNotContent05 = false),
        (this.isShowNotContent06 = false),
        (this.isShowAllList = true);
      this.isShowNotStartList = false;
      this.isShowDoneList = false;
      this.isShowtargetPolicyList = false;
      this.isShowWardenList = false;
      this.isShowtargetOrgList = false;
    },
    //    未开始申请
    choosedTarget02() {
      this.classId = null;

      this.isChoosed01 = false;
      this.isChoosed02 = true;
      this.isChoosed03 = false;

      (this.isShowNotContent01 = false),
        (this.isShowNotContent02 = true),
        (this.isShowNotContent03 = false),
        (this.isShowNotContent04 = false),
        (this.isShowNotContent05 = false),
        (this.isShowNotContent06 = false),
        (this.isShowAllList = false);
      this.isShowNotStartList = true;
      this.isShowDoneList = false;
      this.isShowtargetPolicyList = false;
      this.isShowWardenList = false;
      this.isShowtargetOrgList = false;
    },
    //    审核完毕申请
    choosedTarget03() {
      this.classId = null;

      this.isChoosed01 = false;
      this.isChoosed02 = false;
      this.isChoosed03 = true;

      (this.isShowNotContent01 = false),
        (this.isShowNotContent02 = false),
        (this.isShowNotContent03 = true),
        (this.isShowNotContent04 = false),
        (this.isShowNotContent05 = false),
        (this.isShowNotContent06 = false),
        (this.isShowAllList = false);
      this.isShowNotStartList = false;
      this.isShowDoneList = true;
      this.isShowtargetPolicyList = false;
      this.isShowWardenList = false;
      this.isShowtargetOrgList = false;
    },
    //    管理员申请
    choosedTarget04() {
      this.classId = null;

      (this.isShowNotContent01 = false),
        (this.isShowNotContent02 = false),
        (this.isShowNotContent03 = false),
        (this.isShowNotContent04 = true),
        (this.isShowNotContent05 = false),
        (this.isShowNotContent06 = false),
        (this.isChoosed01 = false);
      this.isChoosed02 = true;
      this.isChoosed03 = false;

      this.isShowAllList = false;
      this.isShowNotStartList = false;
      this.isShowDoneList = false;
      this.isShowtargetPolicyList = false;
      this.isShowWardenList = true;
      this.isShowtargetOrgList = false;
    }
  },
  created() {}
};
</script>
